<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css"></style>
</head>
<body>
    <h1>高度获取</h1>
    <hr>

    <div style="height: 600px"></div>
    <script>

        window.onresize = function() {
            console.log('视口高度: ' + document.documentElement.clientHeight, ' : ','文档高度: ' + document.documentElement.scrollHeight);
        }
    
    </script>
</body>
</html>